<?php
include_once 'controller/default.php';
include_once 'connection/connection_database.php';

class support {

    function Insert($support) {
        $sql = "INSERT INTO support(support_name, yahoo_name, yahoo_id, skype_name, skype_id, phone, email, level)"; 
        $sql .= "VALUES('{$support["support_name"]}', '{$support["yahoo_name"]}', '{$support["yahoo_id"]}', '{$support["skype_name"]}', '{$support["skype_id"]}', '{$support["phone"]}', '{$support["email"]}', '{$support["support_level"]}')";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function Delete($support) {
        $sql = "DELETE FROM support WHERE support_id='{$support["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function Update($support) {
        $sql = "UPDATE support SET support_name='{$support["support_name"]}', yahoo_name='{$support["yahoo_name"]}', yahoo_id='{$support["yahoo_id"]}', skype_name='{$support["skype_name"]}', skype_id='{$support["skype_id"]}', phone='{$support["phone"]}', email='{$support["email"]}', level='{$support["support_level"]}' WHERE support_id='{$support["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function FillAll() {
        $sql = "SELECT * FROM support";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function FillOne($support) {
        $sql = "SELECT * FROM support WHERE support_id='{$support["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return mysql_fetch_array($result);
    }
}

?>
